/**      
 * @file		personInit.cpp
 * @description		This example demonstrates structs within structs
 *			as members.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include <cstring>
using namespace std;

// Notice the enclosed struct must
// be defined before it is used
struct Person {
	char mName[256];
	char mSSID[10];
};

struct Student {
	Person mPerson;		// struct can be part of another struct
	char mSID[256];		// student id
};

struct Instructor {
	Person mPerson;		// struct can be part of another struct
	double mSalary;
};

/**
 * @return zero if the application executes successfully
 */
int main() {

	// demonstrates how you initialize your structs when
	// you declare them. This looks almost like an array
	// initialization, however, structs can have different
	// data type member, arrays can't. Structs have data that
	// is related in some form or another, array's can have
	// elements that are unrelated
	Person aPerson = { "Brad Rippe", "000000000" };
	Student student = { aPerson, "@00000001" };
	Instructor instructor = { aPerson, 2000.0 };

	cout.setf(ios::showpoint);
	cout.setf(ios::fixed);
	cout.precision(2);

	// notice the dot notation
	// Syntax: Object.member.membersMember
	// or Object.enclosedObject.enclosedMember
	cout << "Student name " << student.mPerson.mName << endl;
	cout << "Student social " << student.mPerson.mSSID << endl;
	cout << "Student student id " << student.mSID << endl;

	cout << "Instr name " << instructor.mPerson.mName << endl;
	cout << "Instr social " << instructor.mPerson.mSSID << endl;
	cout << "Instr salary $" << instructor.mSalary << endl;

	return 0;
}

